import Vue from 'vue';
import Router from 'vue-router';
import {config} from "../config";
import orderList from '@/views/orderList.vue';
import comment from '@/views/comment.vue';
import userList from '@/views/userList.vue';
import setting from '@/views/setting.vue';
import login from '@/views/login.vue';
import index from '@/views/index.vue';
import adminList from '@/views/adminList.vue';
import menuManage from '@/views/menuManage.vue';
import materialManage from '@/views/materialManage.vue';

/**
 * 创建路由
 */
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login//登录页面
    },
    {
      path:'/index',
      name:'index',
      component:index,//后台页面
      children:[
        {
          path:'orderList',
          component:orderList
        },
        {
          path:'userList',
          component:userList
        },
        {
          path:'comment',
          component:comment
        },
        {
          path:'setting',
          component:setting
        },
        {
          path:'adminList',
          component:adminList
        },
        {
          path:'menuManage',
          component:menuManage
        },
        {
          path:'materialManage',
          component:materialManage
        }
      ]
    }
  ]
})
